﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using DataAccess.ArchivesTableAdapters;
using DataAccess;

namespace BusinessLogic
{
    [DataObject]
    public class RoleBO
    {
        private tblRollTableAdapter RollAdapter = null;
        protected tblRollTableAdapter Adapter
        {
            get
            {
                if (RollAdapter == null)
                {
                    RollAdapter = new tblRollTableAdapter();   
                }
                return RollAdapter;
            }
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public Archives.tblRollDataTable GetAllRoll()
        {
            return Adapter.GetAllRolls();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
        public int AddNewRoll(string rName)
        {
            return Adapter.Insert(rName);
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Delete, true)]
        public int DeleteRoll(int rID)
        {
            return Adapter.Delete(rID);
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Update, true)]
        public int UpdateRoll(string rName, int rID)
        {
            return Adapter.Update(rName, rID);
        }
    }
}
